import request from '@/utils/request'

export function getGroupPerm(data) {
  return request({
    url: '/api/System/GroupPermission/' + data,
    method: 'get',
    params: { id: data }
  })
}

export function setGroupPerm(data) {
  return request({
    url: '/api/System/PermissionDetail',
    method: 'post',
    params: data
  })
}

export function getResourceDetail(data) {
  let detailUrl = '/api/System/PermissionDetail';
  if (data.id) {
    detailUrl += "/" + data.id; 
  }
  if (data.groupid) {
    detailUrl += "/" + data.groupid; 
  }
  return request({
    url: detailUrl,
    method: 'get',
    params: data
  })
}